
import Fetch from "../utils/fetch";
import Request from "../utils/request";
// import  Vue  from "vue";
// let that = Vue.prototype


// 首页图片轮播
export const banner = () => Fetch.get("/banner")
// export const banner = () => that.$http.get("/banner")

// export const banner = () =>  Request({
//     url:"/api/banner",
//     headers:{
//         DeviceType: 'H5'
//     }
// })

// 首页列表
export const cartlist = () => Fetch.get("/recommend/appIndex")


//讲师详情
export const teacherId = (data) => Fetch.get(`/teacher/${data}`)
//讲师关注 teacher/collect/52?
export const teacherCollect = (data) => Fetch.get(`/teacher/collect/${data}`)
//讲师列表
export const teacherList = (data) => Fetch.get(`/collect`,data)
//讲师列表取消关注
export const noteacher = (data) => Fetch.put(`/collect/cancel/${data}/2`)

export const teacherInfo = (data) => Request({
    url: `/api/teacher/info/${data}`,
    method: "GET"
})


//课程详情
export const courceId = (data) => Request({
    url: `/api/courseInfo/basis_id=${data}`,
    method: "GET"
})

//特色课--分类 
export const courseify = () => Request({
    url: `/api/courseClassify`,
    method: "GET"
})

//分类-分页?page=1&limit=10
export const coursebasis = (data) => Fetch.get('/courseBasis', data)


//收藏collect
export const collect = (data) => Fetch.post('/collect', data)

//取消课程收藏
export const nocollect = (data) => Fetch.put(`/collect/cancel/${data}/1`)

//收藏列表
export const collectlist = (data) => Fetch.get('/collect', data)


//分享
export const share = () => Fetch.post('/public/share')

//用户userinfo
export const Userinfo = () => Fetch.get('/userInfo')
//user信息
export const UserCenter = () => Fetch.get('/getUCenterInfo')

// 获取验证码
export const SmsVerification = (data) => Fetch.post('/smsCode',data)


// 验证码登录
export const VerificationLogin = (data) => Fetch.post('/login',data)

// 确认密码
export const secondPassword = (data) => Fetch.post('/password',data)

// 登录接口
export const login = (data) => Fetch.post('/login',data)

//学科年级  /module/attribute/1
export const attr = () => Fetch.get('/module/attribute/1')

//用户个人信息提交更改

export const user = (data) => Fetch.put('/user',data)
//更换用户头像

export const avatar = (data) => Fetch.post('/public/img',data)

//省市区城市
export const city = (data) => Fetch.get(`/sonArea/${data}`)


//我的学习
export const mystaus = (type) => Fetch.get(`/myStudy/${type}`)
//学习日历  查看当天课程内容
export const myrili = (data) => Fetch.get(`/study/live/${data}`)

// 学习日历 当月的学习日历 /app/study/schedule?date=2019-8-1&
export const myrlisutdy = (data) => Fetch.get(`/study/schedule?date=${data}`)

//日历 course_type==1
export const getRoom = (data) => Fetch.get(`/oto/getLiveRoomCode/${data}/0`)

export const getRoomCode = (dataid, chapterID) => Fetch.get(`/getPcRoomCode/course_id=${dataid}/chapter_id=${chapterID}`)
